<?php
require 'db.php';//链接数据库
$text=$_POST['text'];//获取数据表的表单-昵称
$radio =$_POST['radio'];
$j=$_POST['j'];
$k=$_POST['k'];
$l=$_POST['l'];
$sql="insert into tb_books(tushu,lei,jg,zz,zbs) values('$text','$radio','$j','$k','$l')";//sql语句-添加数据语句
$rs=$db->query($sql);
if($rs){
    echo '<script anguage="javascript">';
    echo 'alert("成功了！");';
    echo 'window.location.href="index.php"';
    echo '</script>';
}else{
     echo '<script anguage="javascript">';
    echo 'alert("失败了！");';
    echo 'window.location.href="index.php"';
    echo '</script>';  
}
$db->close();//执行完本文件代码，关闭数据库


